import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int t=scanner.nextInt();
        int sum=0;
        for (int i = 0; i < t; i++) {
            int a=scanner.nextInt();
            sum=0;
            while (a>4){
                sum++;
                a-=4;
            }
            sum++;
            System.out.println(sum);
        }
    }
}